package com.edu.user.service;

import com.edu.api.entity.common.Pageable;
import com.edu.api.entity.common.ResponseDTO;
import com.edu.api.entity.user.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.List;

/**
 *
 */
public interface UserService extends IService<User> {

   ResponseDTO resetBackstagePwdById(Integer id);

    /**
     * 注册或登录
     * @param phone
     * @param password
     * @param name
     * @param regIp
     * @param portrait
     * @return
     */
    ResponseDTO register(String phone, String password,String name, String regIp,String portrait);

    /**
     * 通过token获取用户信息
     * @param request
     * @return
     */
    ResponseDTO getUserInfo(HttpServletRequest request);

    ResponseDTO updateUser(User user);

    ResponseDTO updatePassword(String id,String newPwd,String oldPwd);

    /**
     * 手机号是否注册过
     * @param phone
     * @return
     */
    Integer checkPhone(String phone);

    /**
     * 后台用户登录
     * @param phone
     * @param password
     * @return
     */
    ResponseDTO backstageLogin(String phone,String password);

    /**
     * 获取所用用户
     * @return
     */
    ResponseDTO getAllUser(Pageable pageable,User user) throws ParseException;

    /**
     * 修改用户状态
     * @param id
     * @param status
     * @return
     */
    ResponseDTO updateUserStatus(Integer id,String status);

    /**
     * 添加或修改后台用户
     * @param user
     * @param request
     * @return
     */
    ResponseDTO addOrUpdateBackStageUser(User user,HttpServletRequest request);

    /**
     * 批量删除用户
     * @param ids
     * @return
     */
    ResponseDTO deleteUserByIds(List ids);
}
